<script setup lang="ts">
import { ref,watch } from 'vue';


const count=ref(0);
const otherCount=ref(0)
const onChange=()=>{
    count.value=1;
}
watch(count,(newValue,oldValue)=>{
    console.log(newValue,oldValue);
});
watch([count,otherCount],(newValue,oldValue)=>{
    console.log(newValue,oldValue);
});
</script>

<template>
    <hr/>
    <slot></slot>
    <button @click="onChange">add</button>
    <div>watch count result:{{ count }}</div>
</template>